from rest_framework import viewsets, mixins
from rest_framework.permissions import AllowAny
from apps.subscriptions.models import Subscription
from apps.subscriptions.serializers import SubscriptionSerializer


class SubscriptionViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet):
    """
    API endpoint that allows Subscriptions to be viewed, created, updated or deleted.
    """
    queryset = Subscription.objects.all()
    serializer_class = SubscriptionSerializer
    permission_classes = [AllowAny]
